<?php
/* @var $this UsersController */
/* @var $model Users */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'users-pers-form',
	'enableAjaxValidation'=>false,
)); ?>
	<div id ="group_pers">
	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'user_id'); ?>
		<?php echo CHtml::dropDownList('user_id','',$data->getUserAll(),array('prompt' => 'Chọn người dùng')); ?>
		<?php echo $form->error($model,'user_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'group_id'); ?>
		<?php echo CHtml::dropDownList('group_id','',$data->getUserGroupAll(),array('prompt' => 'Chọn nhóm người dùng')); ?>
		<?php echo $form->error($model,'group_id'); ?>
	</div>


	<div class="row buttons">
		<?php  echo CHtml::button("Chấp nhận",array(
                    'onclick'=>CHtml::ajax(array(
                                'url'=>Yii::app()->controller->createUrl('user/permission'),
                                'type'=>'post',
                                'update'=>'#group_pers',
                                'data'=>"js:$('#users-pers-form').serialize()"
                                ))
                        )
                              ); ?>
	</div>
</div>
<?php $this->endWidget(); ?>

</div><!-- form -->